var mysql  = require('mysql');

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '',
  port: '3306',
  database: 'test',
});

connection.connect();

var  addSql = 'INSERT INTO tp_name(id,name) VALUES(null,?)';
var  addSqlParams = ['菜鸟工具'];
//增
connection.query(addSql,addSqlParams,function (err, result) {
        if(err){
         console.log('[INSERT ERROR] - ',err.message);
         return;
        }

       console.log('--------------------------INSERT----------------------------');
       //console.log('INSERT ID:',result.insertId);
       console.log('INSERT ID:',result);
       console.log('-----------------------------------------------------------------\n\n');
});

connection.end();
